package mapper;

import java.lang.reflect.ParameterizedType;

import util.MybatisTools;

public class Mapper <T> {
	private T mapper;
	public Mapper() {
		@SuppressWarnings("unchecked")
		Class <T> entityClass = (Class <T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; 
		setMapper(MybatisTools.getMapper(entityClass));
	}
	public T getMapper() {
		return mapper;
	}
	public void setMapper(T mapper) {
		this.mapper = mapper;
	}
}
